package com.liyunc.demo.bundle.security.model;

import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.authority.AuthorityUtils;

/**
 * @author liyuncong
 * @version 1.0
 * @file JwtCredential.java
 * @brief JwtCredential
 * @details JwtCredential
 * @date 2022-03-31
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                        NAME               DESCRIPTION
 * 2022-03-31                  liyuncong          Created
 */
public class JwtCredential extends AbstractAuthenticationToken {
    private final String jwt;

    public JwtCredential(final String jwt) {
        super(AuthorityUtils.NO_AUTHORITIES);
        this.jwt = jwt;
    }

    @Override
    public Object getCredentials() {
        return this.jwt;
    }

    @Override
    public Object getPrincipal() {
        return this.jwt;
    }
}
